home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / src / bin / graffiti / gui.c < prev    next >
C/C++ Source or Header  |  1992-12-03  |  1KB  |  75 lines

  1. #include <stdio.h>
  2. #include <sys/types.h>
  3. #include <sys/time.h>
  4. #include <math.h>
  5. #include "ooglutil.h"
  6. #include "3d.h"
  7. #include "forms.h"
  8. #include "panel.h"
  9. #include "graffiti.h"
  10.  
  11. gui_init()
  12. {
  13.   foreground();
  14.   create_the_forms();
  15.   fl_show_form(MainForm, FL_PLACE_SIZE, TRUE, "Graffiti");
  16. }
  17.  
  18. gui_main_loop()
  19. {
  20.   int fdmask;
  21.   static struct timeval timeout = {0, 200000};
  22.  
  23.   while (1) {
  24.  
  25.     fdmask = 1 << fileno(stdin);
  26.     select(fileno(stdin)+1, &fdmask, NULL, NULL, &timeout);
  27.  
  28.     if (async_fnextc(stdin,0) != NODATA) {
  29.       Input();
  30.     }
  31.     fl_check_forms();
  32.   }
  33. }
  34.  
  35. void QuitProc(FL_OBJECT *obj, long val)
  36. {
  37.   DeleteHeadAndTail();
  38.   exit(0);
  39. }
  40.  
  41. void UndoButtonProc(FL_OBJECT *obj, long val)
  42. {
  43.   RemoveVertex();
  44. }
  45.  
  46. void DrawButtonProc(FL_OBJECT *obj, long val)
  47. {
  48.   NewLine();
  49. }
  50.  
  51. void VertexButtonProc(FL_OBJECT *obj, long val)
  52. {
  53.   onlyverts = fl_get_button(obj);
  54. }
  55.  
  56. PushDrawButtonUp()
  57. {
  58.   fl_set_button(DrawButton, FALSE);
  59. }
  60.  
  61. PushDrawButtonDown()
  62. {
  63.   fl_set_button(DrawButton, TRUE);
  64. }
  65.  
  66. DisplayPickInfoPanel()
  67. {
  68.   fl_show_form(PickInfoForm, FL_PLACE_MOUSE, TRUE, "Graffiti Info");
  69. }
  70.  
  71. void DoneButtonProc(FL_OBJECT *obj, long val)
  72. {
  73.   fl_hide_form(PickInfoForm);
  74. }
  75.